<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value='相册'}}
{{assign var="app" value='photo'}}
{{assign var="act" value='insert'}}
{{assign var="table" value='photo'}}
{{assign var="uploadPlug" value='plupload'}}
<title>{{$title}}管理 - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}editable/editable.html"}}
{{include file="{{$smarty.const.PLUG}}115box/115box.html"}}
<style>
.body_right #quickmenu{padding:5px 15px;}
.body_right>#content{padding:5px;}
.body_right{top:0 !important;}
</style>
</head>
<body>

	<div class="body_right">
		<div id="content">
			<dl class="dbox">
				<dt class="lside">
					<div class="floatr">
						{{if $smarty.get.URL}}<a class="np coolbg fontwn" href="{{$smarty.const.URL_}}">返回相册</a>{{/if}}
						<a class="btn fontwn" href="javascript:document.location.reload();"><i class="icon-refresh"></i>刷新</a>
						<a class="btn btn-info iframe fontwn" width="650px" height="320px" title="上传相片" href="index.php?app=photo&act={{$uploadPlug}}&item={{$smarty.get.item}}{{if $smarty.get.subdir}}&subdir={{$smarty.get.subdir}}{{/if}}{{if $smarty.get.table}}&table={{$smarty.get.table}}{{/if}}{{if $smarty.get.idid}}&idid={{$smarty.get.idid}}{{/if}}&iframe=true"><i class="icon-upload-alt"></i>上传相片</a>
					</div>
					{{$catname}}
					<span style="padding-left:10px;font-weight:normal;color:turquoise;">（温馨提示：双击可选择图片）</span>
				</dt>
				<dd>
					<div id="quickmenu">
						{{if !$result}}{{*是否有显示结果 S*}}
						<div class="result_empty" style="min-height:430px;"></div>
						{{else}}
						<div class="listthumb" style="min-height:390px;">
						<ul>
						{{foreach from=$result item=val}}
							<li class="">
								<!-- <div class="checkbox checked">
									<input class="check_id" type="checkbox" style="display:none;" value="1" name="check_id[]">
								</div> -->
								<div class="file-thumb photo-box">
									<div class="boxout">
										<div class="boxin">
											<a title="双击选择" href="javascript:">
												<img src="{{$val.link|photo:92:93}}" lang="{{$val.link}}" class="insert_img" alt="{{$val.title}}"/>
											</a>
										</div>
									</div>
									<!-- <a href="javascript:" class="star" >星标</a>
									<a class="star {{if $val.publish==1}}publish{{/if}}" href="index.php?app=functions&act=publish&table=images&id={{$val.id}}&value={{$val.publish}}">星标</a> -->
								</div>
								<div class="file-name"> 
									<a href="javascript:" class="editable" data="{{'table='|cat:$table|cat:'&field=title&id='|cat:$val.id|encode}}" title="{{$val.title|default:"暂无描述"}}">{{$val.title|default:"暂无描述"}}</a>
								</div>
								<div class="file-info">选择图片</div>
								<div class="file-opt">
									<a href="{{$smarty.const.__PUB__}}{{$val.link}}" class="i-preview zoom"  title="{{$val.title|default:"暂无描述"}}"><i class="icon-eye-open"></i></a>
									<a link="index.php?app=photo&act=delete&id={{$val.id}}" class="ajaxSubmit confirm refresh i-delete" title="删除将不可恢复,确定要删除吗?"><i class="icon-trash"></i></a>
								</div>
							</li>
						{{/foreach}}
						</ul>
						<div class="clear"></div>
						</div>
						{{/if}}{{*是否有显示结果 E*}}
						<div class="clear"></div>
					</div>
					<script>
						$(document).ready(function(){
							$(".insert_img").dblclick(function(){
								//alert($(this).attr("lang"));
								if("{{$smarty.get.type}}"=="input"){//input输入框
									if('{{$smarty.get.name}}'!='') {//name
										var exp_input = "input[name='{{$smarty.get.name}}']";//for input
										var exp_img = "img[id='{{$smarty.get.name}}_img']";//for img
									}else if('{{$smarty.get.id}}'!='') {//id
										var exp_input = "input#{{$smarty.get.id}}";//for input
										var exp_img = "img[id='{{$smarty.get.id}}_img']";//for img
									}
									$(window.parent.document).find(exp_input).val($(this).attr("lang"));//将路径插入input框
									$(window.parent.document).find(exp_img).attr('src','{{$smarty.const.__PUB__}}'+$(this).attr("lang")); //更新img标签
								}else if("{{$smarty.get.type}}"=="ueditor"){//ueditor
									if('{{$smarty.get.class}}'!=''){
										parent.UE.getEditor('{{$smarty.get.class}}').execCommand('insertHtml', "<img src='{{$smarty.const.__PUB__}}"+($(this).attr("lang"))+"' />")
									}else{
										parent.UE.getEditor(parent.$('.editor').attr('id')).execCommand('insertHtml', "<img src='{{$smarty.const.__PUB__}}"+($(this).attr("lang"))+"' />")
									}
								}else if("{{$smarty.get.type}}"=="xheditor"){//xheditor
									if('{{$smarty.get.class}}'!=''){
										parent.$('.{{$smarty.get.class}}').xheditor().loadBookmark();//获得编辑器的焦点
										parent.$('.{{$smarty.get.class}}').xheditor().pasteHTML("<img src='{{$smarty.const.__PUB__}}"+($(this).attr("lang"))+"' />");//(设置源代码2)
									}else{
										parent.xheditor.loadBookmark();//获得编辑器的焦点
										parent.xheditor.pasteHTML("<img src='{{$smarty.const.__PUB__}}"+($(this).attr("lang"))+"' />");//(设置源代码2)
									}
								}
								parent.$.fn.colorbox.close();//关闭colorbox
							});
							
						});
					</script>
					{{include file="include/page.html"}}
				</dd>
			</dl>
		</div>
	</div>

</body>
</html>